<template>
	<view class="custom-coupon" @click="jumpCustom(message)">
		<view class="custom-coupon-title">{{message.payload.custom.title}}</view>
		<image class="custom-coupon-image"
			:src="cdn(message.payload.custom.imgUrl)" mode="widthFix"></image>
	</view>
</template>

<script setup>
	import sheep from '@/sheep';
	import {cdn,udid} from '@/im/config/index.js'
	
	const props = defineProps({
		message: {
			type: Object,
			default: {}
		}
	})
	
	const jumpCustom = (msg) => {
		if (udid === msg.payload.custom.tag) {
			uni.navigateTo({
				url:msg.payload.custom.linkUrl
			})
		} else {
			uni.showToast({
				title: '请前往指定平台查看详情!',
				icon: 'none',
				duration: 2000
			});
		}
	}
</script>

<style scoped lang="scss">
	.custom-coupon {
		width: 452rpx;
		background: #FFFFFF;
		border-radius: 12rpx;
		padding: 15rpx;
	
		.custom-coupon-title {
			font-weight: 350;
			font-size: 28rpx;
			color: #333333;
		}
	
		.custom-coupon-image {
			width: 420rpx;
			margin-top: 20rpx;
		}
	}
</style>